//
//  SHNewslistCell.m
//  UI_CarHome
//
//  Created by dllo on 15/10/22.
//  Copyright (c) 2015年 沈浩. All rights reserved.
//

#import "SHNewslistCell.h"
#import "SHHandle.h"


@implementation SHNewslistCell

- (void)dealloc
{
    [_leftImageView release];
    [_titleLabel release];
    [_timeLabel release];
    [_replycountLabel release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

//- (void)setArr
- (void)createView
{
    self.leftImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.leftImageView];
    [_leftImageView release];
    
    self.timeLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.timeLabel];
    self.timeLabel.textColor = TEXTCOLOR;
    [_timeLabel release];
    
    self.titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.titleLabel];
    self.titleLabel.textColor = TEXTCOLOR;
    [_titleLabel release];
    
    self.replycountLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.replycountLabel];
    [_replycountLabel release];
    self.replycountLabel.textColor = TEXTCOLOR;
    
    self.shuoKeLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.shuoKeLabel];
    [_shuoKeLabel release];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.leftImageView.frame = CGRectMake(10 * WID, 10 * HEI, WIDTHS / 3 - 15 * WID, HEIGHTS - 20 * HEI);
    self.titleLabel.frame = CGRectMake(WIDTHS / 3, 10 * HEI, WIDTHS * 2 / 3 - 20 * WID, (HEIGHTS - 20) / 2);
    self.timeLabel.frame = CGRectMake(WIDTHS / 3, HEIGHTS * 3 / 4, WIDTHS / 3 - 15 * WID, HEIGHTS / 4 - 10 * HEI);
    self.replycountLabel.frame = CGRectMake(WIDTHS * 5 / 6 - 5 * WID, HEIGHTS * 3 / 4, WIDTHS / 6 - 5 * WID, HEIGHTS / 4 - 10 * HEI);
    
    self.shuoKeLabel.frame = CGRectMake(WIDTHS * 5 / 6 + 5 * WID, HEIGHTS / 2, WIDTHS / 6 - 15 * WID, HEIGHTS / 4 - 10 * HEI);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
